<template>
	<view>
		<uni-easyinput v-model="value" placeholder="" />
		<button type="default" @click="changeTitle">动态设置当前页面的标题</button>
		<button type="default" @click="changeTitlebg">动态设置当前页面的标题</button>
		<button type="default" @click="changeTitleLoading">在当前页面显示导航条加载动画</button>
		<button type="default" @click="changeTitleStopLoading">在当前页面显示导航条结束动画</button>
		<button type="default" @click="hideHomeButton">隐藏返回首页按钮(小程序)</button>
		当用户打开的小程序最底层页面是非首页时，默认展示“返回首页”按钮，开发者可在页面onShow中调用hideHomeButton进行隐藏。
	</view>
</template>

<script>
export default {
	data() {
		return {
			value: '我是东，我来自南方'
		};
	},
	methods: {
		changeTitle() {
			let _this = this;
			uni.setNavigationBarTitle({
				title: _this.value
			});
		},
		changeTitlebg() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: '#ff0000',
				animation: {
					duration: 400,
					timingFunc: 'easeIn'
				}
			});
		},
		changeTitleLoading() {
			uni.showNavigationBarLoading();
		},
		changeTitleStopLoading() {
			uni.hideNavigationBarLoading();
		},
		hideHomeButton(){
			uni.hideHomeButton()
		}
	}
};
</script>

<style scoped></style>
